package com.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 日志工具类
 */
public class LogUtil {

    /**
     * 获取业务日志logger
     *
     * @param clazz 类名
     * @return logger
     */
    public static Logger getBusinessLogger(Class<?> clazz) {
        return LoggerFactory.getLogger("business." + clazz.getSimpleName());
    }

    /**
     * 获取平台日志logger
     *
     * @param clazz 类名
     * @return logger
     */
    public static Logger getPlatformLogger(Class<?> clazz) {
        return LoggerFactory.getLogger("platform." + clazz.getSimpleName());
    }

    /**
     * 获取数据库日志logger
     *
     * @param clazz 类名
     * @return logger
     */
    public static Logger getDBLogger(Class<?> clazz) {
        return LoggerFactory.getLogger("db." + clazz.getSimpleName());
    }

    /**
     * 获取缓存日志logger
     *
     * @param clazz 类名
     * @return logger
     */
    public static Logger getCacheLogger(Class<?> clazz) {
        return LoggerFactory.getLogger("cache." + clazz.getSimpleName());
    }
}